from django.shortcuts import render
from App.models import *


# 首页
def index(request):
    return render(request, 'index.html')

# 用户列表
def user_list(request):
    # 获取所有用户信息
    users = UserModel.objects.all()
    # 渲染模板
    return render(request, 'user_list.html', {'users': users})


# 用户详情
def user_detail(request, uid):
    print('uid:', uid)
    user = UserModel.objects.get(pk=uid)
    return render(request, 'user_detail.html', {'user': user})